3.83 \(\int \frac{x^2 \log (e (\frac{a+b x}{c+d x})^n)}{f+g x+h x^2} \, dx\)

Optimal. Leaf size=831 \[ \frac{n (a+b x) \log (a+b x)}{b h}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log \left (-\frac{b \left (g+2 h x-\sqrt{g^2-4 f h}\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right ) \log (a+b x)}{2 h^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log \left (-\frac{b \left (g+2 h x+\sqrt{g^2-4 f h}\right )}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right ) \log (a+b x)}{2 h^2}-\frac{n (c+d x) \log (c+d x)}{d h}-\frac{x \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h}+\frac{\left (g^2-2 f h\right ) \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h^2 \sqrt{g^2-4 f h}}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g+2 h x-\sqrt{g^2-4 f h}\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g+2 h x+\sqrt{g^2-4 f h}\right )}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \log \left (h x^2+g x+f\right )}{2 h^2}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{PolyLog}\left (2,\frac{2 h (a+b x)}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{PolyLog}\left (2,\frac{2 h (a+b x)}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{PolyLog}\left (2,\frac{2 h (c+d x)}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{PolyLog}\left (2,\frac{2 h (c+d x)}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2} \]

[Out]

(n*(a + b*x)*Log[a + b*x])/(b*h) - (n*(c + d*x)*Log[c + d*x])/(d*h) - (x*(n*Log[a + b*x] - Log[e*((a + b*x)/(c
 + d*x))^n] - n*Log[c + d*x]))/h + ((g^2 - 2*f*h)*ArcTanh[(g + 2*h*x)/Sqrt[g^2 - 4*f*h]]*(n*Log[a + b*x] - Log
[e*((a + b*x)/(c + d*x))^n] - n*Log[c + d*x]))/(h^2*Sqrt[g^2 - 4*f*h]) - ((g - (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h]
)*n*Log[a + b*x]*Log[-((b*(g - Sqrt[g^2 - 4*f*h] + 2*h*x))/(2*a*h - b*(g - Sqrt[g^2 - 4*f*h])))])/(2*h^2) + ((
g - (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*Log[c + d*x]*Log[-((d*(g - Sqrt[g^2 - 4*f*h] + 2*h*x))/(2*c*h - d*(g -
Sqrt[g^2 - 4*f*h])))])/(2*h^2) - ((g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*Log[a + b*x]*Log[-((b*(g + Sqrt[g^2
- 4*f*h] + 2*h*x))/(2*a*h - b*(g + Sqrt[g^2 - 4*f*h])))])/(2*h^2) + ((g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*L
og[c + d*x]*Log[-((d*(g + Sqrt[g^2 - 4*f*h] + 2*h*x))/(2*c*h - d*(g + Sqrt[g^2 - 4*f*h])))])/(2*h^2) + (g*(n*L
og[a + b*x] - Log[e*((a + b*x)/(c + d*x))^n] - n*Log[c + d*x])*Log[f + g*x + h*x^2])/(2*h^2) - ((g - (g^2 - 2*
f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*h*(a + b*x))/(2*a*h - b*(g - Sqrt[g^2 - 4*f*h]))])/(2*h^2) - ((g + (g^
2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*h*(a + b*x))/(2*a*h - b*(g + Sqrt[g^2 - 4*f*h]))])/(2*h^2) + ((g
 - (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*h*(c + d*x))/(2*c*h - d*(g - Sqrt[g^2 - 4*f*h]))])/(2*h^2)
 + ((g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*h*(c + d*x))/(2*c*h - d*(g + Sqrt[g^2 - 4*f*h]))])/(
2*h^2)

________________________________________________________________________________________

Rubi [A]  time = 1.06817, antiderivative size = 831, normalized size of antiderivative = 1., number of steps used = 30, number of rules used = 12, integrand size = 34, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.353, Rules used = {2513, 2418, 2389, 2295, 2394, 2393, 2391, 703, 634, 618, 206, 628} \[ \frac{n (a+b x) \log (a+b x)}{b h}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log \left (-\frac{b \left (g+2 h x-\sqrt{g^2-4 f h}\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right ) \log (a+b x)}{2 h^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log \left (-\frac{b \left (g+2 h x+\sqrt{g^2-4 f h}\right )}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right ) \log (a+b x)}{2 h^2}-\frac{n (c+d x) \log (c+d x)}{d h}-\frac{x \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h}+\frac{\left (g^2-2 f h\right ) \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h^2 \sqrt{g^2-4 f h}}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g+2 h x-\sqrt{g^2-4 f h}\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g+2 h x+\sqrt{g^2-4 f h}\right )}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \log \left (h x^2+g x+f\right )}{2 h^2}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{PolyLog}\left (2,\frac{2 h (a+b x)}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{PolyLog}\left (2,\frac{2 h (a+b x)}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{PolyLog}\left (2,\frac{2 h (c+d x)}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{PolyLog}\left (2,\frac{2 h (c+d x)}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2} \]

Antiderivative was successfully verified.

[In]

Int[(x^2*Log[e*((a + b*x)/(c + d*x))^n])/(f + g*x + h*x^2),x]

[Out]

(n*(a + b*x)*Log[a + b*x])/(b*h) - (n*(c + d*x)*Log[c + d*x])/(d*h) - (x*(n*Log[a + b*x] - Log[e*((a + b*x)/(c
 + d*x))^n] - n*Log[c + d*x]))/h + ((g^2 - 2*f*h)*ArcTanh[(g + 2*h*x)/Sqrt[g^2 - 4*f*h]]*(n*Log[a + b*x] - Log
[e*((a + b*x)/(c + d*x))^n] - n*Log[c + d*x]))/(h^2*Sqrt[g^2 - 4*f*h]) - ((g - (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h]
)*n*Log[a + b*x]*Log[-((b*(g - Sqrt[g^2 - 4*f*h] + 2*h*x))/(2*a*h - b*(g - Sqrt[g^2 - 4*f*h])))])/(2*h^2) + ((
g - (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*Log[c + d*x]*Log[-((d*(g - Sqrt[g^2 - 4*f*h] + 2*h*x))/(2*c*h - d*(g -
Sqrt[g^2 - 4*f*h])))])/(2*h^2) - ((g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*Log[a + b*x]*Log[-((b*(g + Sqrt[g^2
- 4*f*h] + 2*h*x))/(2*a*h - b*(g + Sqrt[g^2 - 4*f*h])))])/(2*h^2) + ((g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*L
og[c + d*x]*Log[-((d*(g + Sqrt[g^2 - 4*f*h] + 2*h*x))/(2*c*h - d*(g + Sqrt[g^2 - 4*f*h])))])/(2*h^2) + (g*(n*L
og[a + b*x] - Log[e*((a + b*x)/(c + d*x))^n] - n*Log[c + d*x])*Log[f + g*x + h*x^2])/(2*h^2) - ((g - (g^2 - 2*
f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*h*(a + b*x))/(2*a*h - b*(g - Sqrt[g^2 - 4*f*h]))])/(2*h^2) - ((g + (g^
2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*h*(a + b*x))/(2*a*h - b*(g + Sqrt[g^2 - 4*f*h]))])/(2*h^2) + ((g
 - (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*h*(c + d*x))/(2*c*h - d*(g - Sqrt[g^2 - 4*f*h]))])/(2*h^2)
 + ((g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*h*(c + d*x))/(2*c*h - d*(g + Sqrt[g^2 - 4*f*h]))])/(
2*h^2)

Rule 2513

Int[Log[(e_.)*((f_.)*((a_.) + (b_.)*(x_))^(p_.)*((c_.) + (d_.)*(x_))^(q_.))^(r_.)]*(RFx_.), x_Symbol] :> Dist[
p*r, Int[RFx*Log[a + b*x], x], x] + (Dist[q*r, Int[RFx*Log[c + d*x], x], x] - Dist[p*r*Log[a + b*x] + q*r*Log[
c + d*x] - Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r], Int[RFx, x], x]) /; FreeQ[{a, b, c, d, e, f, p, q, r}, x] &&
RationalFunctionQ[RFx, x] && NeQ[b*c - a*d, 0] &&  !MatchQ[RFx, (u_.)*(a + b*x)^(m_.)*(c + d*x)^(n_.) /; Integ
ersQ[m, n]]

Rule 2418

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[
(a + b*Log[c*(d + e*x)^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n}, x] && RationalFunct
ionQ[RFx, x] && IntegerQ[p]

Rule 2389

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rule 2295

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2394

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[(Log[(e*(f +
g*x))/(e*f - d*g)]*(a + b*Log[c*(d + e*x)^n]))/g, x] - Dist[(b*e*n)/g, Int[Log[(e*(f + g*x))/(e*f - d*g)]/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n}, x] && NeQ[e*f - d*g, 0]

Rule 2393

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))]*(b_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Dist[1/g, Subst[Int[(a +
 b*Log[1 + (c*e*x)/g])/x, x], x, f + g*x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] && EqQ[g
 + c*(e*f - d*g), 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 703

Int[((d_.) + (e_.)*(x_))^(m_)/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(e*(d + e*x)^(m - 1))/(c*
(m - 1)), x] + Dist[1/c, Int[((d + e*x)^(m - 2)*Simp[c*d^2 - a*e^2 + e*(2*c*d - b*e)*x, x])/(a + b*x + c*x^2),
 x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*
e, 0] && GtQ[m, 1]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{x^2 \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )}{f+g x+h x^2} \, dx &=n \int \frac{x^2 \log (a+b x)}{f+g x+h x^2} \, dx-n \int \frac{x^2 \log (c+d x)}{f+g x+h x^2} \, dx-\left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \int \frac{x^2}{f+g x+h x^2} \, dx\\ &=-\frac{x \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h}+n \int \left (\frac{\log (a+b x)}{h}-\frac{(f+g x) \log (a+b x)}{h \left (f+g x+h x^2\right )}\right ) \, dx-n \int \left (\frac{\log (c+d x)}{h}-\frac{(f+g x) \log (c+d x)}{h \left (f+g x+h x^2\right )}\right ) \, dx-\frac{\left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \int \frac{-f-g x}{f+g x+h x^2} \, dx}{h}\\ &=-\frac{x \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h}+\frac{n \int \log (a+b x) \, dx}{h}-\frac{n \int \frac{(f+g x) \log (a+b x)}{f+g x+h x^2} \, dx}{h}-\frac{n \int \log (c+d x) \, dx}{h}+\frac{n \int \frac{(f+g x) \log (c+d x)}{f+g x+h x^2} \, dx}{h}+\frac{\left (g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )\right ) \int \frac{g+2 h x}{f+g x+h x^2} \, dx}{2 h^2}-\frac{\left (\left (g^2-2 f h\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )\right ) \int \frac{1}{f+g x+h x^2} \, dx}{2 h^2}\\ &=-\frac{x \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h}+\frac{g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \log \left (f+g x+h x^2\right )}{2 h^2}-\frac{n \int \left (\frac{\left (g+\frac{-g^2+2 f h}{\sqrt{g^2-4 f h}}\right ) \log (a+b x)}{g-\sqrt{g^2-4 f h}+2 h x}+\frac{\left (g-\frac{-g^2+2 f h}{\sqrt{g^2-4 f h}}\right ) \log (a+b x)}{g+\sqrt{g^2-4 f h}+2 h x}\right ) \, dx}{h}+\frac{n \int \left (\frac{\left (g+\frac{-g^2+2 f h}{\sqrt{g^2-4 f h}}\right ) \log (c+d x)}{g-\sqrt{g^2-4 f h}+2 h x}+\frac{\left (g-\frac{-g^2+2 f h}{\sqrt{g^2-4 f h}}\right ) \log (c+d x)}{g+\sqrt{g^2-4 f h}+2 h x}\right ) \, dx}{h}+\frac{n \operatorname{Subst}(\int \log (x) \, dx,x,a+b x)}{b h}-\frac{n \operatorname{Subst}(\int \log (x) \, dx,x,c+d x)}{d h}+\frac{\left (\left (g^2-2 f h\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )\right ) \operatorname{Subst}\left (\int \frac{1}{g^2-4 f h-x^2} \, dx,x,g+2 h x\right )}{h^2}\\ &=\frac{n (a+b x) \log (a+b x)}{b h}-\frac{n (c+d x) \log (c+d x)}{d h}-\frac{x \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h}+\frac{\left (g^2-2 f h\right ) \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h^2 \sqrt{g^2-4 f h}}+\frac{g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \log \left (f+g x+h x^2\right )}{2 h^2}-\frac{\left (\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log (a+b x)}{g-\sqrt{g^2-4 f h}+2 h x} \, dx}{h}+\frac{\left (\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log (c+d x)}{g-\sqrt{g^2-4 f h}+2 h x} \, dx}{h}-\frac{\left (\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log (a+b x)}{g+\sqrt{g^2-4 f h}+2 h x} \, dx}{h}+\frac{\left (\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log (c+d x)}{g+\sqrt{g^2-4 f h}+2 h x} \, dx}{h}\\ &=\frac{n (a+b x) \log (a+b x)}{b h}-\frac{n (c+d x) \log (c+d x)}{d h}-\frac{x \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h}+\frac{\left (g^2-2 f h\right ) \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h^2 \sqrt{g^2-4 f h}}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \log \left (f+g x+h x^2\right )}{2 h^2}+\frac{\left (b \left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log \left (\frac{b \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{-2 a h+b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{a+b x} \, dx}{2 h^2}-\frac{\left (d \left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log \left (\frac{d \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{-2 c h+d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{c+d x} \, dx}{2 h^2}+\frac{\left (b \left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log \left (\frac{b \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{-2 a h+b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{a+b x} \, dx}{2 h^2}-\frac{\left (d \left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log \left (\frac{d \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{-2 c h+d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{c+d x} \, dx}{2 h^2}\\ &=\frac{n (a+b x) \log (a+b x)}{b h}-\frac{n (c+d x) \log (c+d x)}{d h}-\frac{x \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h}+\frac{\left (g^2-2 f h\right ) \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h^2 \sqrt{g^2-4 f h}}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \log \left (f+g x+h x^2\right )}{2 h^2}+\frac{\left (\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 h x}{-2 a h+b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{x} \, dx,x,a+b x\right )}{2 h^2}-\frac{\left (\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 h x}{-2 c h+d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{x} \, dx,x,c+d x\right )}{2 h^2}+\frac{\left (\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 h x}{-2 a h+b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{x} \, dx,x,a+b x\right )}{2 h^2}-\frac{\left (\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 h x}{-2 c h+d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{x} \, dx,x,c+d x\right )}{2 h^2}\\ &=\frac{n (a+b x) \log (a+b x)}{b h}-\frac{n (c+d x) \log (c+d x)}{d h}-\frac{x \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h}+\frac{\left (g^2-2 f h\right ) \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{h^2 \sqrt{g^2-4 f h}}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \log \left (f+g x+h x^2\right )}{2 h^2}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{Li}_2\left (\frac{2 h (a+b x)}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{Li}_2\left (\frac{2 h (a+b x)}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{Li}_2\left (\frac{2 h (c+d x)}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{Li}_2\left (\frac{2 h (c+d x)}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 h^2}\\ \end{align*}

Mathematica [A]  time = 5.47177, size = 1105, normalized size = 1.33 \[ \frac{2 d h \sqrt{g^2-4 f h} (a+b x) \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-2 b d f h \log \left (g+2 h x-\sqrt{g^2-4 f h}\right ) \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )+b d g \left (g-\sqrt{g^2-4 f h}\right ) \log \left (g+2 h x-\sqrt{g^2-4 f h}\right ) \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )+2 b d f h \log \left (g+2 h x+\sqrt{g^2-4 f h}\right ) \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-b d g \left (g+\sqrt{g^2-4 f h}\right ) \log \left (g+2 h x+\sqrt{g^2-4 f h}\right ) \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-2 (b c-a d) h \sqrt{g^2-4 f h} n \log (c+d x)+2 b d f h n \left (\left (\log \left (\frac{2 h (a+b x)}{-g b+\sqrt{g^2-4 f h} b+2 a h}\right )-\log \left (\frac{2 h (c+d x)}{-g d+\sqrt{g^2-4 f h} d+2 c h}\right )\right ) \log \left (g+2 h x-\sqrt{g^2-4 f h}\right )+\text{PolyLog}\left (2,\frac{b \left (-g-2 h x+\sqrt{g^2-4 f h}\right )}{-g b+\sqrt{g^2-4 f h} b+2 a h}\right )-\text{PolyLog}\left (2,\frac{d \left (-g-2 h x+\sqrt{g^2-4 f h}\right )}{2 c h+d \left (\sqrt{g^2-4 f h}-g\right )}\right )\right )-b d g \left (g-\sqrt{g^2-4 f h}\right ) n \left (\left (\log \left (\frac{2 h (a+b x)}{-g b+\sqrt{g^2-4 f h} b+2 a h}\right )-\log \left (\frac{2 h (c+d x)}{-g d+\sqrt{g^2-4 f h} d+2 c h}\right )\right ) \log \left (g+2 h x-\sqrt{g^2-4 f h}\right )+\text{PolyLog}\left (2,\frac{b \left (-g-2 h x+\sqrt{g^2-4 f h}\right )}{-g b+\sqrt{g^2-4 f h} b+2 a h}\right )-\text{PolyLog}\left (2,\frac{d \left (-g-2 h x+\sqrt{g^2-4 f h}\right )}{2 c h+d \left (\sqrt{g^2-4 f h}-g\right )}\right )\right )-2 b d f h n \left (\left (\log \left (\frac{2 h (a+b x)}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )-\log \left (\frac{2 h (c+d x)}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )\right ) \log \left (g+2 h x+\sqrt{g^2-4 f h}\right )+\text{PolyLog}\left (2,\frac{b \left (g+2 h x+\sqrt{g^2-4 f h}\right )}{b \left (g+\sqrt{g^2-4 f h}\right )-2 a h}\right )-\text{PolyLog}\left (2,\frac{d \left (g+2 h x+\sqrt{g^2-4 f h}\right )}{d \left (g+\sqrt{g^2-4 f h}\right )-2 c h}\right )\right )+b d g \left (g+\sqrt{g^2-4 f h}\right ) n \left (\left (\log \left (\frac{2 h (a+b x)}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )-\log \left (\frac{2 h (c+d x)}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )\right ) \log \left (g+2 h x+\sqrt{g^2-4 f h}\right )+\text{PolyLog}\left (2,\frac{b \left (g+2 h x+\sqrt{g^2-4 f h}\right )}{b \left (g+\sqrt{g^2-4 f h}\right )-2 a h}\right )-\text{PolyLog}\left (2,\frac{d \left (g+2 h x+\sqrt{g^2-4 f h}\right )}{d \left (g+\sqrt{g^2-4 f h}\right )-2 c h}\right )\right )}{2 b d h^2 \sqrt{g^2-4 f h}} \]

Antiderivative was successfully verified.

[In]

Integrate[(x^2*Log[e*((a + b*x)/(c + d*x))^n])/(f + g*x + h*x^2),x]

[Out]

(2*d*h*Sqrt[g^2 - 4*f*h]*(a + b*x)*Log[e*((a + b*x)/(c + d*x))^n] - 2*(b*c - a*d)*h*Sqrt[g^2 - 4*f*h]*n*Log[c
+ d*x] - 2*b*d*f*h*Log[e*((a + b*x)/(c + d*x))^n]*Log[g - Sqrt[g^2 - 4*f*h] + 2*h*x] + b*d*g*(g - Sqrt[g^2 - 4
*f*h])*Log[e*((a + b*x)/(c + d*x))^n]*Log[g - Sqrt[g^2 - 4*f*h] + 2*h*x] + 2*b*d*f*h*Log[e*((a + b*x)/(c + d*x
))^n]*Log[g + Sqrt[g^2 - 4*f*h] + 2*h*x] - b*d*g*(g + Sqrt[g^2 - 4*f*h])*Log[e*((a + b*x)/(c + d*x))^n]*Log[g
+ Sqrt[g^2 - 4*f*h] + 2*h*x] + 2*b*d*f*h*n*((Log[(2*h*(a + b*x))/(-(b*g) + 2*a*h + b*Sqrt[g^2 - 4*f*h])] - Log
[(2*h*(c + d*x))/(-(d*g) + 2*c*h + d*Sqrt[g^2 - 4*f*h])])*Log[g - Sqrt[g^2 - 4*f*h] + 2*h*x] + PolyLog[2, (b*(
-g + Sqrt[g^2 - 4*f*h] - 2*h*x))/(-(b*g) + 2*a*h + b*Sqrt[g^2 - 4*f*h])] - PolyLog[2, (d*(-g + Sqrt[g^2 - 4*f*
h] - 2*h*x))/(2*c*h + d*(-g + Sqrt[g^2 - 4*f*h]))]) - b*d*g*(g - Sqrt[g^2 - 4*f*h])*n*((Log[(2*h*(a + b*x))/(-
(b*g) + 2*a*h + b*Sqrt[g^2 - 4*f*h])] - Log[(2*h*(c + d*x))/(-(d*g) + 2*c*h + d*Sqrt[g^2 - 4*f*h])])*Log[g - S
qrt[g^2 - 4*f*h] + 2*h*x] + PolyLog[2, (b*(-g + Sqrt[g^2 - 4*f*h] - 2*h*x))/(-(b*g) + 2*a*h + b*Sqrt[g^2 - 4*f
*h])] - PolyLog[2, (d*(-g + Sqrt[g^2 - 4*f*h] - 2*h*x))/(2*c*h + d*(-g + Sqrt[g^2 - 4*f*h]))]) - 2*b*d*f*h*n*(
(Log[(2*h*(a + b*x))/(2*a*h - b*(g + Sqrt[g^2 - 4*f*h]))] - Log[(2*h*(c + d*x))/(2*c*h - d*(g + Sqrt[g^2 - 4*f
*h]))])*Log[g + Sqrt[g^2 - 4*f*h] + 2*h*x] + PolyLog[2, (b*(g + Sqrt[g^2 - 4*f*h] + 2*h*x))/(-2*a*h + b*(g + S
qrt[g^2 - 4*f*h]))] - PolyLog[2, (d*(g + Sqrt[g^2 - 4*f*h] + 2*h*x))/(-2*c*h + d*(g + Sqrt[g^2 - 4*f*h]))]) +
b*d*g*(g + Sqrt[g^2 - 4*f*h])*n*((Log[(2*h*(a + b*x))/(2*a*h - b*(g + Sqrt[g^2 - 4*f*h]))] - Log[(2*h*(c + d*x
))/(2*c*h - d*(g + Sqrt[g^2 - 4*f*h]))])*Log[g + Sqrt[g^2 - 4*f*h] + 2*h*x] + PolyLog[2, (b*(g + Sqrt[g^2 - 4*
f*h] + 2*h*x))/(-2*a*h + b*(g + Sqrt[g^2 - 4*f*h]))] - PolyLog[2, (d*(g + Sqrt[g^2 - 4*f*h] + 2*h*x))/(-2*c*h
+ d*(g + Sqrt[g^2 - 4*f*h]))]))/(2*b*d*h^2*Sqrt[g^2 - 4*f*h])

________________________________________________________________________________________

Maple [F]  time = 1.393, size = 0, normalized size = 0. \begin{align*} \int{\frac{{x}^{2}}{h{x}^{2}+gx+f}\ln \left ( e \left ({\frac{bx+a}{dx+c}} \right ) ^{n} \right ) }\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*ln(e*((b*x+a)/(d*x+c))^n)/(h*x^2+g*x+f),x)

[Out]

int(x^2*ln(e*((b*x+a)/(d*x+c))^n)/(h*x^2+g*x+f),x)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*log(e*((b*x+a)/(d*x+c))^n)/(h*x^2+g*x+f),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{x^{2} \log \left (e \left (\frac{b x + a}{d x + c}\right )^{n}\right )}{h x^{2} + g x + f}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*log(e*((b*x+a)/(d*x+c))^n)/(h*x^2+g*x+f),x, algorithm="fricas")

[Out]

integral(x^2*log(e*((b*x + a)/(d*x + c))^n)/(h*x^2 + g*x + f), x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*ln(e*((b*x+a)/(d*x+c))**n)/(h*x**2+g*x+f),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{x^{2} \log \left (e \left (\frac{b x + a}{d x + c}\right )^{n}\right )}{h x^{2} + g x + f}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*log(e*((b*x+a)/(d*x+c))^n)/(h*x^2+g*x+f),x, algorithm="giac")

[Out]

integrate(x^2*log(e*((b*x + a)/(d*x + c))^n)/(h*x^2 + g*x + f), x)